package com.qlk.vorder.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.vorder.dao.ReserveSessionDao;
import com.qlk.vorder.domain.ReserveSession;
import com.qlk.vorder.domain.query.ReserveSessionQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * ReserveSessionDAO实现类<br/>
 * 对'预约订单会话记录'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-7-28 14:13:59
 * 
 */
@Repository
public class ReserveSessionDaoImpl extends BaseDao implements ReserveSessionDao {
	/** namespace */
	private final String namespace = ReserveSessionDaoImpl.class.getName();

	/**
	 * {@inheritDoc}
	 */
	public List<ReserveSession> queryReserveSessionList(ReserveSessionQuery queryBean) {
		return (List<ReserveSession>) queryForList(namespace + ".queryReserveSessionList", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean insert(ReserveSession reserveSession) {
		return insert(namespace + ".insert", reserveSession);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean update(ReserveSession reserveSession) {
		return update(namespace + ".update", reserveSession);
	}

	/**
	 * {@inheritDoc}
	 */
	public int queryReserveSessionCount(ReserveSessionQuery queryBean) {
		return (Integer) queryForObject(namespace + ".queryReserveSessionCount", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<ReserveSession> queryReserveSessionListWithPage(ReserveSessionQuery queryBean) {
		return (List<ReserveSession>) queryForList(namespace + ".queryReserveSessionListWithPage", queryBean);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean delete(ReserveSession configuration) {
		return delete(namespace + ".delete", configuration);
	}

	/**
	 * {@inheritDoc}
	 */
	public ReserveSession getReserveSessionById(Long id) {
		return (ReserveSession) queryForObject(namespace + ".getReserveSessionById", id);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean exist(ReserveSession reserveSession) {
		int count = (Integer) queryForObject(namespace + ".exist", reserveSession);
		return count > 0;
	}
}
